<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>友情提示</title>
</head>
<body>

</body>
<script type="text/javascript" src="{{URL::asset('layui/layui.js')}}"></script>
<script type="text/javascript">
	layui.use('layer', function(){
		var layer = layui.layer;
		layer.open({
			type: 0,
			area: ['450px','250px'],
			closeBtn: 0,
			content: "<center><h2>{{$data['content']}}</h2> <br /><span id='time' value='3'>3</span>秒后自动跳转登录页面 <br /> <a href='{{$data['url']}}' ><font color='red'>点击跳转</font></a></center>", //这里content是一个普通的String
			end:function(){
			       
				location.href = "{{$data['url']}}";
			}
		});
		var time = document.getElementById('time');	//获取3 2 1 的对象
		//定时器函数两个参数 第一个处理函数 第二个是多长时间走一回
		var timeing = setInterval(function(){
			if(time.innerHTML != 0){
				time.innerHTML = --time.innerHTML;
			}

			if(time.innerHTML == 0){
				location.href = "{{ $data['url']}}";
				clearInterval(timeing);
			}
		},1000);
	});

</script>
</html>
